passwd (database)

passwd is a name service database used to store user account information on Unix-like operating systems.

The sources for the passwd database (and hence the sources of user accounts on a system) are configured, like other name service databases, in nsswitch.conf.

Contents

Command line

The getent command can be used to fetch passwd information.

Fetching a list of all available users

getent passwd

Fetching a specific user entry

For a specific user called 'joe':

getent passwd joe

For a specific uid being '33':

getent passwd 33

Python

The 'pwd' module can be used.[1]

References

  1. ^ 35.2. pwd — The password database Python v2.7.2 documentation